<!--
**************************************************************************
* Copyright (C) 2009-2015 EPAM Systems
*
* This file is part of Indigo Signature Service.
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 3 as published by the Free Software
* Foundation and appearing in the file LICENSE.GPL included in the
* packaging of this file.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
***************************************************************************
-->
<script type="text/ng-template" id="uploadDocumentTmpl">
    <div class="modal-header">
        <h2>Upload New Document<span ng-click="cancel()" title="Close"></span></h2>
    </div>
    <div class="modal-body">
        <div ng-show="UploadModel.Mode==1">
            <div class="popup-control-group upload">
                <label>Select document</label>
                <input type="text" value="{{UploadModel.File.name}}" readonly/>
                <div class="add-file">
                    <input type="file" ng-file-select="onFileSelect($files)" name="inpFile" id="inpFile" accept="application/pdf"/>
                    <label for="inpFile" class="btn btn-primary">Browse</label>
                </div>
            </div>
            <div class="popup-control-group  upload">
                <label>Select Template</label>
                <select ng-model="UploadModel.Template" ng-options="template.name for template in MODEL.templates"></select>
            </div>
        </div>
        <div ng-if="UploadModel.Mode==2">
            <div>Uploading: {{UploadModel.File.name  | characters:55}}</div>
            <progressbar animate="true" value="UploadModel.UploadProgressPercent" type="success"><b>{{UploadModel.UploadProgressPercent}}%</b></progressbar>
        </div>
        <div ng-if="UploadModel.Mode==3">
            <div>Uploading '{{UploadModel.File.name | characters:55}}' is complete.</div>
        </div>
        <div class="error-templates text-center" ng-if="UploadModel.Error != ''">{{UploadModel.Error}}</div>
    </div>
    <div class="modal-footer">
        <button class="btn" ng-click="upload()" ng-if="UploadModel.Mode==1">Submit</button>
        <button class="btn" ng-click="cancel()" ng-if="UploadModel.Mode==1">Cancel</button>
        <button class="btn" ng-click="abort()" ng-if="UploadModel.Mode==2">Cancel</button>
        <button class="btn" ng-click="cancel()" ng-if="UploadModel.Mode==3">Ok</button>
    </div>
</script>